//package com.java.java基础.线程;
//
///**
// * 线程运用-售票系统
// */
//public class ThreadS4 {
//    public static void main(String[] args) {
//        SellTick st = new SellTick();
//        SellTick st2 = new SellTick();
//        SellTick st3 = new SellTick();
//        st.start();
//        st2.start();
//        st3.start();
//    }
//
//}
//
///*1.继承Thread类来实现*/
////class SellTick extends Thread {
////    private static int ticket = 100;
////        while(true) {
////        if (ticket <= 0) {
////            break;
////        } else {
////            System.out.println("售票窗口：" + Thread.currentThread().getName() + "正在售票，票号为：" + ticket);
////            ticket--;
////        }
////        // 休眠1秒
////        try {
////            Thread.sleep(1000);
////        }catch (InterruptedException e){
////            e.printStackTrace();
////        }
////        System.out.println( "售票窗口：" + Thread.currentThread().getName() + "售票结束");
////    }
////}
